<!-- 基础分页组件（Vue 2） -->
<template>
  <div class="pagination" v-if="total > pageSize">
    <button :disabled="page===1" @click="$emit('change', page-1)">上一页</button>
    <span>第 {{ page }} / {{ totalPages }} 页</span>
    <button :disabled="page===totalPages" @click="$emit('change', page+1)">下一页</button>
  </div>
</template>

<script>
export default {
  name: 'BasePagination',
  props: { total: Number, page: Number, pageSize: Number },
  computed: { totalPages() { return Math.ceil(this.total / this.pageSize) } }
}
</script>

<style>
.pagination { display:flex; gap:8px; align-items:center; }
button[disabled] { opacity:0.5; cursor:not-allowed; }
</style>

